use std::{
    io::Cursor,
    ops::{Deref, DerefMut},
};

#[derive(Debug, Clone)]
pub struct AudioClip {
    source: Cursor<Vec<u8>>,
}

impl Deref for AudioClip {
    type Target = Cursor<Vec<u8>>;

    fn deref(&self) -> &Self::Target {
        &self.source
    }
}

impl DerefMut for AudioClip {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.source
    }
}

impl AudioClip {
    pub fn new(source: Vec<u8>) -> Self {
        let source = Cursor::new(source);

        Self { source }
    }
}
